package lab02.test21;

import java.util.Scanner;

/**
 * Created by admin on 2017/10/30.
 */
public class Test {
    public static void main(String[] args) {
        int tem=0;
        Scanner in=new Scanner(System.in);
        System.out.println("输入任意字符串：");
        String string=in .next();
        String id;
        System.out.println("请输入求频率的字符：");
        id=in.next();
        for(int i=0;i<string.length();i++){
            if (string.charAt(i)==id.charAt(0)){
    tem=tem+1;
            }
        }
        System.out.println(id.charAt(0)+"出现的频率为："+tem);
    }
}
